/**
 * 				PropertieReader.java
 *				------------
 *		
 *   Author:	bin04017
 *   ID:		bin04017
 *	 Created:	25.01.2007
 *	 Project:	Mochito
 *	 Package:	mochito.tools.properties
 *	 Usage:		
 */
package mochito.tools.properties;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @author bin04017
 * 
 */
public class PropertieReader {
	// Read properties file.
	private static Properties properties = new Properties();

	private static boolean readed = false;
	
	private static String host = "localhost";
	
	private static Integer port = 2007;

	private static Properties getProperties() {
		try {
			
			if (!readed) {
				properties.load(new FileInputStream("mochitoClipboard.properties"));
				host = (String)properties.get("host");
				port = Integer.parseInt((String) properties.get("port"));
				readed = true;
			}			
		} catch (IOException e) {
			e.printStackTrace();
		}
		return properties;
	}
	
	public static String getHost(){
		getProperties();
		return host;
	}
	
	public static Integer getPort(){
		getProperties();
		return port;
	}
}
